<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>实际班次管理</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
$(document).ready(function() {
	//$("#name").focus();
	$("#inputForm").validate({
		submitHandler: function(form){
			
		var	Boardnum=$("#tRealscheBoardList tr").length;
		var	Offnum=$("#tRealscheOffList tr").length;
		var	Vehinum=$("#tRealscheVehiList tr").length;
		//判断集合时间是否按条件正确输入
		var lastOffList =Offnum -1;
		var offid= "#tRealscheOffList"+lastOffList+"_gathertime";
		var offidGathertime = $(offid).val();
		//得到班次类型的值
		var schetype = document.getElementById("schetype").value;
		if(Boardnum<1){
			alert("还未添加上客点");
		}
		else if(Offnum<1){
			alert("还未添加下客点");
		}
		else if(Vehinum<1){
			alert("还未添加车辆信息");
		}else if(schetype==3){
			if(offidGathertime.length!=0 ){
				alert("下客点最后集合时间不能输入值");
			}else{
				loading('正在提交，请稍等...');
				form.submit();
			}
		}else if(schetype==4){
			if(offidGathertime==""||offidGathertime==null||offidGathertime==undefined ){
				alert("下客点最后集合时间不能为空");
			}else{
				loading('正在提交，请稍等...');
				form.submit();
			}
		}else{
			loading('正在提交，请稍等...');
			form.submit();
		}
		},
		errorContainer: "#messageBox",
		errorPlacement: function(error, element) {
			$("#messageBox").text("输入有误，请先更正。");
			if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
				error.appendTo(element.parent().parent());
			} else {
				error.insertAfter(element);
			}
		}
	});
});
function addRow(list, idx, tpl, row){
	var data;
	var schetype = document.getElementById("schetype").value;
	if(row) { // 加载后台的有默认值
		data = {idx: idx, delBtn: true, row:row,schetype:schetype};
		if(list=="#tRealscheVehiList"){
		 var num=$("#tRealscheVehiList tr").length;
		 var prefix = list + num;
		 keypress(row.office.id,prefix);
		 keypresstwo(row.office.id, row.licno,prefix);
		}
		//查询保存的上下客点信息
		if(list=="#tRealscheBoardList"){
			 var num=$("#tRealscheBoardList tr").length;
			var prefix = list + num;	
			checkCode(row.citycode,prefix,1);
		}if(list=="#tRealscheOffList"){
			 var num=$("#tRealscheOffList tr").length;
			var prefix = list + num;
			checkCode(row.citycode,prefix,2);
		}
	} else { // 新增的是没有默认值的
		//获取当前动态行的行数
		//上客点
		var num;
		if(list=="#tRealscheBoardList"){
			num=$("#tRealscheBoardList tr").length;
		}
		//下客点
		if(list=="#tRealscheOffList"){
			num=$("#tRealscheOffList tr").length;
		}
		//车辆
		 if(list=="#tRealscheVehiList"){
			num=$("#tRealscheVehiList tr").length;
		}
		data = {idx: num, delBtn: true,schetype:schetype};
	}
	
	var html = template(tpl, data); // 渲染模板
	
	$(list).append(html);
	$(list+idx).find("select").each(function(){
		$(this).val($(this).attr("data-value"));
		$(this).find("option[selected='selected']").attr("selected",'selected'); 
	});
	if(list =="#tRealscheVehiList"){
		countSeats();
	}
	/* var tlineobj =document.getElementById("tline");
	var tlinevalue = tlineobj.options[tlineobj.selectedIndex].value;
	tlineChange(tlinevalue);  */
	data = {idx: num, delBtn: true};
}
 function delRow(obj, prefix){
		var id = $(prefix+"_id");
		var delFlag = $(prefix+"_delFlag");
		if (id.val() == ""){
			$(obj).parent().parent().remove();
		}else if(delFlag.val() == 0){
			delFlag.val("1");
			$(obj).html("&divide;").attr("title", "撤销删除");
			$(obj).parent().parent().addClass("error");
		}else if(delFlag.val() == 1){
			delFlag.val("0");
			$(obj).html("&times;").attr("title", "删除");
			$(obj).parent().parent().removeClass("error");
		}
		countSeats();
	}
 //计算车辆和车辆数
function countSeats(){		
	// 车辆定义
	var sum = 0;
	var list = $('tbody[id=tRealscheVehiList] tr td input');
	var length = list.length;
	var num = length/5;
	if(length>0) {
		var i=1;
		list.each(function(){
			if(i%5==0){
				var single = this.value;
				if(typeof(single)!="undefined" && single!=''){
					sum += parseInt(single);
				}
			}
			i++;
		});
	}
	$('input[name=totalseats]').val(sum);
	$('input[name=vehiclenum]').val(num);	
}

//选中车辆型号
function checkLicenseno(licenseno){
	//<c:forEach items="${tRealscheVehJsson}" var="item">
	if("${item.licno}"==licenseno){
		return true;
	}
	//</c:forEach>
	return false;
}


//通过选择客运公司显示汽车型号
function keypress(officeids,prefix){  
	
	var vehiclename = prefix+"_licno";
	url = "${ctx}/schedef/tSchedef/ajaxVehiclename";
	 $.ajax({
          dataType: 'json',
            url:url,
            data:{officeids:officeids},
            type: 'POST',
            cache:false,
            success: function(data) {
            	 var obj = eval(data);
            	 var html = '';
            	 var chus='';
            	 jQuery(vehiclename).html('');
            	  $.each(obj, function (i, item) {
            		  //jQuery(vehiclename).append("<option value="+ item.vehiclename+"<if text="${item.scheid==scheid}">selected = "+selected+"</if>>"+ item.vehiclename+"</option>");
            		  var select =  checkLicenseno(item.licenseno)?"selected=selected":"";
            		  //console.log(item.vehiclename)
            		  //console.log('----'+select);
            		   chus=  "<option value='"+'' +"' >"+ '--请选择--'+"</option>" ;
            		  html+="<option value='"+ item.licenseno+"' "+select+">"+ item.licenseno+"</option>";
            	  }); 
            	  var htmls = chus +html;
            	  jQuery(vehiclename).html(htmls);
            	  //console.log(html)
            	countSeats();
            	//keypresstwo(row.office.id, row.vehiclename,prefix);
            },
            error: function() {
            		 alert("数据有误");
            }
        });     
} 
//通过汽车车牌号显示汽车信息
function keypresstwo(officeids,licno,prefix){
	var vehiclename = prefix+"_vehiclename";
	var seats = prefix+"_seats";
	var maindriver = prefix+"_maindriver";
	url = "${ctx}/schedef/tSchedef/ajaxList";
	 $.ajax({
          dataType: 'json',
            url:url,
            data:{officeids:officeids,licno:licno},
            type: 'POST',
            success: function(data) {
            	//console.log(data);
            	 var obj = eval(data);
            	
            	 $(seats).val(obj[0].seats);
            	 $(maindriver).val(obj[0].drvname);
            	 $(vehiclename).val(obj[0].vehiclename);
            	/*  var html = '';
            	 jQuery(licno).html('');
            	  $.each(obj, function (i, item) {
            		 //jQuery(licno).append("<option value="+ item.licenseno+">"+ item.licenseno+"</option>");
            		  var select = checkLicenseno(item.licenseno)?"selected=selected":"";
            		  html+="<option value='"+ item.licenseno+"' "+select+">"+ item.licenseno+"</option>";
            		 }); 
            	  jQuery(licno).html(html); */
            	 countSeats();
            },
            error: function() {
            		 alert("数据有误");
            }
        });     
} 
//修改获取上客点
function checkBoardkStied(siteid){
	//<c:forEach items="${tRealscheBoardJson}" var="item">
	if("${item.boardaddr}"==siteid){
		return true;
	}
	//</c:forEach>
	return false;
}
//修改获取下客点
function checkOffdStied(siteid){
	//<c:forEach items="${tRealscheOffJson}" var="item">
	if("${item.offaddr}"==siteid){
		return true;
	}
	//</c:forEach>
	return false;
}
//通过选择城市显示上客点
function checkCode(code,prefix,type){
	 var board = prefix + "_boardaddr";
	 var offd = prefix + "_offaddr";
	 url = "${ctx}/schedef/tSchedef/ajaxStied";
	 $.ajax({
          	dataType: 'json',
            url:url,
            data:{code:code},
            type: 'POST',
            success: function(data) {
            	var obj = eval(data);
            	 var html = '';
            	 //上客点显示
            	 if(type==1){ 
            		
            		 //alert("boardNum=========="+boardNum);
            		 //jQuery(board).html('');
	            	  $.each(obj, function (i, item) {
	            		 //jQuery(board).append("<option value='"+ item.siteid+"'>"+ item.sitename+"</option>");
	            		  var select = checkBoardkStied(item.sitename)?"selected=selected":"";
	            		  html+="<option value='"+ item.sitename+"' "+select+">"+ item.sitename+"</option>";
	            	}); 
	            	 jQuery(board).html(html);
	            	 //console.log(html)
            	  } 
            	  //下客点显示
            	 else{
            		 //jQuery(offd).html('');
	            	  $.each(obj, function (i, item) {
	            		//jQuery(offd).append("<option value='"+ item.siteid+"'>"+ item.sitename+"</option>");
	            		  var select = checkOffdStied(item.sitename)?"selected=selected":"";
	            		  html+="<option value='"+ item.sitename+"' "+select+">"+ item.sitename+"</option>";
	            	});
	            	  jQuery(offd).html(html);
            	 } 
            },
            error: function() {
            		 alert("数据有误");
            }
        });     
}
		//通过班次类型判断显示上下客点内容
		function typeChange(values){
			 //当类型为景区单  跟团游时显示上客点内容
			if(values==1 ||values==3 || values==4){
                 document.getElementById("type2").style.display ="table-cell"; 
                 document.getElementById("type3").style.display ="table-cell"; 
                 document.getElementById("types4").style.display ="table-cell";
                 
                 document.getElementById("types2").style.display ="none"; 
                 document.getElementById("types3").style.display ="none";
                 //当类型不为跟团游时去掉下客点集合时间显示
                 if(values==1){
                	 document.getElementById("types4").style.display ="none";
                 }
			}
			if(values==2){
                document.getElementById("types2").style.display ="table-cell"; 
                document.getElementById("types3").style.display ="table-cell"; 
                
                document.getElementById("type2").style.display ="none"; 
                document.getElementById("type3").style.display ="none"; 
                document.getElementById("types4").style.display ="none";
			}
		 }
		 $(function(){
            var schetype = '${tRealsche.schetype}';
            typeChange(schetype);
           
		})
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/realsche/tRealsche/">实际班次列表</a></li>
		<li class="active"><a
			href="${ctx}/realsche/tRealsche/form?id=${tRealsche.id}">实际班次<shiro:hasPermission
					name="realsche:tRealsche:edit">${not empty tRealsche.id?'查看':'添加'}</shiro:hasPermission>
				<shiro:lacksPermission name="realsche:tRealsche:edit">查看</shiro:lacksPermission></a></li>
	</ul>
	<br />
	<form:form id="inputForm" modelAttribute="tRealsche"
		action="${ctx}/realsche/tRealsche/save" method="post"
		class="form-horizontal">
		<form:hidden path="id" />
		<sys:message content="${message}" />
		<div class="control-group">
			<label class="control-label">班次名称：</label>
			<div class="controls">
				<form:input  path="schename"  readonly="true" htmlEscape="false"  maxlength="64" class="span4 required" />
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">班次类型：</label>
			<div class="controls">
				<form:select path="schetype" class="span4" onchange="typeChange(this.options[this.options.selectedIndex].value)" disabled="true">
					<form:options items="${fns:getDictList('T_Schede_Type')}"
						itemLabel="label" itemValue="value" htmlEscape="false" />
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">发车日期：</label>
			<div class="controls">
				<input name="departdate" type="text" readonly="readonly"
					maxlength="20" class="span4 Wdate "
					value="<fmt:formatDate value="${tRealsche.departdate}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">车辆数：</label>
			<div class="controls">
				<%-- <input type="hidden" id="vehiclenumDefault" value="${tSchedef.vehiclenum }"/> --%>
				<form:input path="vehiclenum" htmlEscape="false"
					class="span4 required" readonly="true"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">座位数：</label>
			<div class="controls">
				<form:input path="totalseats" htmlEscape="false"
					class="span4 required" readonly="true"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
			<div class="control-group">
			<label class="control-label">上客点：</label>
			<div class="controls">
				<table id="contentTable"
					class="table table-striped table-bordered table-condensed">
					<thead>
						<tr>
							<th class="hide"></th>
							<!-- <th>defboardid</th> -->
							<th  >城市</th> 
							 <th>上客地点</th>
							 <th id="type2"  >零售价</th>
							 <th id="type3"  >分销价</th>
							 <th>上客时间</th>
							<shiro:hasPermission name="realsche:tRealsche:edit">
								<th width="10">&nbsp;</th>
							</shiro:hasPermission>
						</tr>
					</thead>
					<tbody id="tRealscheBoardList">

					</tbody>
					<shiro:hasPermission name="realsche:tRealsche:edit">
						<tfoot>
							<tr><td colspan="6"><a href="javascript:"
							 onclick="addRow('#tRealscheBoardList', tRealscheBoardRowIdx, tRealscheBoardTpl);tRealscheBoardRowIdx = tRealscheBoardRowIdx + 1;" 
							 class="btn">新增</a></td></tr>
						</tfoot>
					</shiro:hasPermission>
				</table>
				<script type="text/template" id="tRealscheBoardTpl">
					<tr id="tRealscheBoardList{{idx}}">
						<td class="hide">
							<input id="tRealscheBoardList{{idx}}_id"
							name="tRealscheBoardList[{{idx}}].id" type="hidden"
							{{if row}}value="{{row.id}}"{{/if}} />
							<input id="tRealscheBoardList{{idx}}_delFlag"
							name="tRealscheBoardList[{{idx}}].delFlag" type="hidden" value="0" />
						</td>
						<td>
								<select id="tRealscheBoardList{{idx}}_citycode" disabled="true" name="tRealscheBoardList[{{idx}}].citycode" class="input-xxlarges" onchange="checkCode(this.options[this.options.selectedIndex].value,'#tRealscheBoardList{{idx}}',1)">  
  								<option value="">--请选择--</option>
								<c:forEach items="${tSitedList}" var="tSited">
  								<option value ="${tSited.citycode}"  {{if row}}{{if row.citycode == '${tSited.citycode}' }}selected="selected"{{/if}}{{/if}}>
  								${tSited.cityname}</option></c:forEach>  
							</select>		
							</td>
						<td>
							<select id="tRealscheBoardList{{idx}}_boardaddr" disabled="true"
							name="tRealscheBoardList[{{idx}}].boardaddr" class="input-xxlarges">
						</select></td>
						{{if schetype ==1 ||schetype==3 ||schetype==4}}
						<td>
							<input id="tRealscheBoardList{{idx}}_retailprice"
							name="tRealscheBoardList[{{idx}}].retailprice" type="text"
							{{if row}}value="{{row.retailprice}}"{{/if}} class="input-small required" />
						</td>
						<td>
							<input id="tRealscheBoardList{{idx}}_settleprice"
							name="tRealscheBoardList[{{idx}}].settleprice" type="text"
							{{if row}}value="{{row.settleprice}}"{{/if}} class="input-small required" />
						</td>
						{{/if}}
						<td><input id="tRealscheBoardList{{idx}}_boardtime"
							name="tRealscheBoardList[{{idx}}].boardtime" type="text"
							readonly="readonly" maxlength="20"
							class="input-medium Wdate required" {{if row}}value="{{row.boardtime}}"{{/if}}
							onclick="WdatePicker({dateFmt:'HH:mm',isShowClear:false});" /></td>
						<shiro:hasPermission name="realsche:tRealsche:edit"><td class="text-center" width="10">
								<span class="close" onclick="delRow(this, '#tRealscheBoardList{{idx}}')" title="删除">&times;</span>
							</td></shiro:hasPermission>
					</tr>
				</script>
				<script type="text/javascript">	
				var tRealscheBoardRowIdx = 0, tRealscheBoardTpl = 'tRealscheBoardTpl';
				$(document).ready(function() {
					var data = ${tRealscheBoardJson};
					console.log(data);
					for (var i=0; i<data.length; i++){
						addRow('#tRealscheBoardList', i, tRealscheBoardTpl, data[i]);
					}
				});
				</script>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">下客点：</label>
			<div class="controls">
				<table id="contentTable"
					class="table table-striped table-bordered table-condensed">
					<thead>
						<tr>
							<th class="hide"></th>
							 <th >城市</th> 
							 <th>下客点地址</th>
							 <th id="types2" style="display:none">零售价</th>
							 <th id="types3" style="display:none">分销价</th>
							<th id="types4" style="display:none">集合时间</th>
							<shiro:hasPermission name="realsche:tRealsche:edit">
								<th width="10">&nbsp;</th>
							</shiro:hasPermission>
						</tr>
					</thead>
					<tbody id="tRealscheOffList">
					</tbody>
					<shiro:hasPermission name="realsche:tRealsche:edit">
						<tfoot>
							<tr><td colspan="5"><a href="javascript:" 
							onclick="addRow('#tRealscheOffList', tRealscheOffRowIdx, tRealscheOffTpl);tRealscheOffRowIdx = tRealscheOffRowIdx + 1;" class="btn">新增</a></td></tr>
						</tfoot></shiro:hasPermission>
				</table>
				<script type="text/template" id="tRealscheOffTpl">
						<tr id="tRealscheOffList{{idx}}">
							<td class="hide">
								<input id="tRealscheOffList{{idx}}_id" name="tRealscheOffList[{{idx}}].id" type="hidden" {{if row}}value="{{row.id}}"{{/if}} />
								<input id="tRealscheOffList{{idx}}_delFlag" name="tRealscheOffList[{{idx}}].delFlag" type="hidden" value="0"/>
							</td>
							<td>
								<select id="tRealscheOffList{{idx}}_citycode" disabled="true" name="tRealscheOffList[{{idx}}].citycode" class="input-xxlarges" onchange="checkCode(this.options[this.options.selectedIndex].value,'#tRealscheOffList{{idx}}',2)">  
  								<option value="">--请选择--</option>
								<c:forEach items="${tSitedList}" var="tSited">
  								<option value ="${tSited.citycode}"  {{if row}}{{if row.citycode == '${tSited.citycode}' }}selected="selected"{{/if}}{{/if}}>
  								${tSited.cityname}</option></c:forEach>  
							</select>		
							</td>
							<td>
								<select id="tRealscheOffList{{idx}}_offaddr" name="tRealscheOffList[{{idx}}].offaddr" class="input-xxlarges" >  
								</select>
							</td>
							{{if schetype ==2}}
							  <td>
								<input id="tRealscheOffList{{idx}}_retailprice"
								name="tRealscheOffList[{{idx}}].retailprice" type="text"
								{{if row}}value="{{row.retailprice}}"{{/if}} class="input-small required" />
							</td>
						    <td>
								<input id="tRealscheOffList{{idx}}_settleprice"
								name="tRealscheOffList[{{idx}}].settleprice" type="text"
								{{if row}}value="{{row.settleprice}}"{{/if}} class="input-small required" />
						    </td>
							{{/if}}
							
							{{if schetype ==3 ||schetype ==4 }}
								<td><input id="tRealscheOffList{{idx}}_gathertime"
								name="tRealscheOffList[{{idx}}].gathertime" type="text"
								readonly="readonly" maxlength="20"
								class="input-medium Wdate " {{if row}}value="{{row.gathertime}}"{{/if}}
								onclick="WdatePicker({dateFmt:'HH:mm',isShowClear:false});" /></td>
							{{/if}}
							<shiro:hasPermission name="realsche:tRealsche:edit"><td class="text-center" width="10">
								<span class="close" onclick="delRow(this, '#tRealscheOffList{{idx}}')" title="删除">&times;</span>
							</td></shiro:hasPermission>
						</tr>
					</script>
				<script type="text/javascript">
				var tRealscheOffRowIdx = 0, tRealscheOffTpl = 'tRealscheOffTpl';
				$(document).ready(function() {
					//var data = '${tSchedefOffJson}';
					var data = ${tRealscheOffJson};
					console.log(data);
					//console.info(data);
					for (var i=0; i<data.length; i++){
						addRow('#tRealscheOffList', i, tRealscheOffTpl, data[i]);
					}
				});
					</script>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">车辆：</label>
			<div class="controls">
				<table id="contentTable"
					class="table table-striped table-bordered table-condensed">
					<thead>
						<tr>
							<th class="hide"></th>
							<th>客运公司</th>
							<th>车牌号</th>
							<th>车型名称</th>
							<th>主司机</th>
							<th>座位数</th>
							<!-- <th>驾驶员</th> -->
							<shiro:hasPermission name="realsche:tRealsche:edit">
								<th width="10">&nbsp;</th>
							</shiro:hasPermission>
						</tr>
					</thead>
					<tbody id="tRealscheVehiList">
					</tbody>
					<shiro:hasPermission name="realsche:tRealsche:edit"><tfoot>
							<tr><td colspan="13"><a href="javascript:" onclick="addRow('#tRealscheVehiList', tRealscheVehiRowIdx, tRealscheVehiTpl);tRealscheVehiRowIdx = tRealscheVehiRowIdx + 1;" class="btn">新增</a></td></tr>
						</tfoot></shiro:hasPermission>
				</table>
				<script type="text/template" id="tRealscheVehiTpl">
						<tr id="tRealscheVehiList{{idx}}">
							<td class="hide">
								<input id="tRealscheVehiList{{idx}}_id" name="tRealscheVehiList[{{idx}}].id" type="hidden" {{if row}}value="{{row.id}}"{{/if}}/>
								<input id="tRealscheVehiList{{idx}}_delFlag" name="tRealscheVehiList[{{idx}}].delFlag" type="hidden" value="0"/>
							</td>
							<td>
								<select id="tRealscheVehiList{{idx}}_office" name="tRealscheVehiList[{{idx}}].office.id" class="input-xxlarges" onchange="keypress(this.options[this.options.selectedIndex].value,'#tRealscheVehiList{{idx}}')">  
  								<option value="">--请选择--</option>
								<c:forEach items="${officelist}" var="offices">
  								<option value ="${offices.id}"  {{if row}}{{if row.office.id == '${offices.id}' }}selected="selected"{{/if}}{{/if}}>
  								${offices.name}</option></c:forEach>  
							</select>		
							</td>
							<td>
								<select id="tRealscheVehiList{{idx}}_licno" name="tRealscheVehiList[{{idx}}].licno" class="input-xxlarges" onchange="keypresstwo(tRealscheVehiList{{idx}}_office.options[tRealscheVehiList{{idx}}_office.options.selectedIndex].value,this.options[this.options.selectedIndex].value,'#tRealscheVehiList{{idx}}')"></select>	  
							</td>
								<td>
								<input id="tRealscheVehiList{{idx}}_vehiclename" name="tRealscheVehiList[{{idx}}].vehiclename" type="text" {{if row}}value="{{row.vehiclename}}"{{/if}} maxlength="50" class="input-small required" readonly/>
							</td>
							<td>
								<input id="tRealscheVehiList{{idx}}_maindriver" name="tRealscheVehiList[{{idx}}].maindriver" type="text" {{if row}}value="{{row.maindriver}}"{{/if}} maxlength="50" class="input-small required" readonly/>
							</td>
							
							<td>
								<input id="tRealscheVehiList{{idx}}_seats" name="tRealscheVehiList[{{idx}}].seats" type="text" {{if row}}value="{{row.seats}}"{{/if}} class="input-small required" readonly/>
							</td>
							<shiro:hasPermission name="realsche:tRealsche:edit"><td class="text-center" width="10">
								<span class="close" onclick="delRow(this, '#tRealscheVehiList{{idx}}')" title="删除">&times;</span>
							</td></shiro:hasPermission>
						</tr>
					</script>
				<script type="text/javascript">
				var tRealscheVehiRowIdx = 0, tRealscheVehiTpl = 'tRealscheVehiTpl';
				$(document).ready(function() {
					 var data = ${tRealscheVehJsson};
					 //console.log(data);
					for (var i=0; i<data.length; i++){
						addRow('#tRealscheVehiList', i, tRealscheVehiTpl, data[i]);
					} 
				});
					</script>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="realsche:tRealsche:edit">
				<input id="btnSubmit" class="btn btn-primary" type="submit"
					value="保 存" />&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回"
				onclick="history.go(-1)" />
		</div>
	</form:form>
</body>
<script type="text/javascript">
	
</script>
</html>